<%@ page contentType="text/html;charset=UTF-8" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<head>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">

    <title>SB Admin 2 - Bootstrap Admin Theme</title>
 	<%@ include file="../../../layout/admin_header.jsp"%>
 	<script src="../../js/usermanagement.js"></script>
 	
</head>

<body>

    <div id="wrapper">
        <div id="page-wrapper">
            <div class="row">
                <div class="col-lg-12">
                    <h1 class="page-header"><spring:message code="user.titleForm"/></h1>
                </div>
            </div>
            <!-- /.row -->
            <div class="row">
                <div class="col-lg-12">
                    <div class="panel panel-default">
                        <div class="panel-heading">
                            <spring:message code="user.titleForm"/>
                        </div>
                        <div class="panel-body">
                            <div class="row">
                                <div class="col-lg-6">
                                    <form role="form" action="edit" method="post">
                                    	<input type="hidden" value="${user.getId()}" name="userid"/>
                                        <div class="form-group">
                                            <label><spring:message code="user.fullname"/></label>
                                            <input class="form-control" name="fullname" id="fullname" value="${user.getFullname()}" placeholder="<spring:message code="user.fullname"/>">
                                        </div>
                                        <div class="form-group">
                                            <label><spring:message code="user.gender"/></label>
                                            <input type="hidden" value="${user.getGender()}" name="userGender" id="userGender"/>
                                            <select name="gender" class="form-control">
                                                <option id="genderOpt1" value="1"><spring:message code="user.male"/></option>
                                                <option id="genderOpt2" value="2"><spring:message code="user.female"/></option>
                                            </select>
                                        </div>
                                        <div class="form-group">
                                            <label>Email</label>
                                            <input class="form-control" name="email" id="email" value="${user.getEmail()}" placeholder="Email">
                                        </div>
                                        <div class="form-group">
                                            <label><spring:message code="user.username"/></label>
                                            <input class="form-control" name="username" id="username" value="${user.getUsername()}" placeholder="<spring:message code="user.username"/>">
                                        </div>
                                        <div class="form-group">
                                            <label><spring:message code="user.password"/></label>
                                            <input class="form-control" name="password" id="password" value="${user.getPassword()}" placeholder="<spring:message code="user.password"/>">
                                        </div>
                                        <div class="form-group">
                                            <label><spring:message code="user.status"/></label>
                                            <input type="hidden" name="userStatus" id="userStatus" value="${user.getStatus()}"/>
                                             <select name="status" id="status" class="form-control">
                                                <option id="statusOpt1" value="1"><spring:message code="user.active"/></option>
                                                <option id="statusOpt0" value="0"><spring:message code="user.inactive"/></option>
                                            </select>
                                        </div>
                                        <div class="form-group">
                                            <label><spring:message code="user.role"/></label>
                                            <input type="hidden" name="userRole" id="userRole" value="${user.getRole()}"/>
                                            <select name="role" id="role" class="form-control">
                                            	<c:forEach var="role" items="${roles}">
                                                	<option id="role${role.getRoleid()}" value="${role.getRoleid()}">${role.getName()}</option>
                                                </c:forEach>
                                            </select>
                                        </div>
                                        <button type="submit" class="btn btn-default"><spring:message code="system.submit"/></button>
                                        <button type="button" onclick="goBack()" class="btn btn-default"><spring:message code="system.cancel"/></button>
                                    </form>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</body>
</html>
